package reflection.equals;

import reflection.equals.assignablefrom.Client;
import reflection.equals.assignablefrom.OldClient;
import reflection.equals.assignablefrom.VipClient;


public class CommonTest {

	private static final Long id = 1L;
	Client client = new Client(id); 
	VipClient vipClient = new VipClient(id); 
	OldClient oldClient = new OldClient(id); 
	
	@Test
	public void testIsInstance()
	{
		Assert.assertTrue(client.getClass().isInstance(client));
		Assert.assertTrue(client.getClass().isInstance(vipClient));
		Assert.assertTrue(client.getClass().isInstance(oldClient));
				
	}
	
	@Test
	public void testIsInstanceOf()
	{
		Assert.assertTrue(client instanceof Client);
		Assert.assertTrue(vipClient instanceof Client);
		Assert.assertTrue(oldClient instanceof Client);
	}
	
	@Test
	public void testIsAssignableFrom()
	{
		Assert.assertTrue(client.getClass().isAssignableFrom(client.getClass()));
		Assert.assertTrue(client.getClass().isAssignableFrom(vipClient.getClass()));
		Assert.assertTrue(client.getClass().isAssignableFrom(oldClient.getClass()));
		
		
	}
	
}
